using NExt.data;
using NExt.grid;
using NExt.UI.Browse.Data;

namespace NExt.Demo.Application.Entity3
{
    public class Browse : GridBrowsePresenter
    {
        protected override ColumnModel BuildColumnModel()
        {
            ColumnModel columnModel = new ColumnModel();
            columnModel.defaultSortable = true;
            columnModel.columns.Add(new RowNumberer());
            columnModel.columns.Add(new Column { header = "Name", width = 120, sortable = true, dataIndex = "Person.Name" });

            return columnModel;
        }

        protected override DataReader BuildReader()
        {
            Record record = new Record();
            record.fields.Add(new FieldDefinition { name = "Person.Name", type = FieldDefinitionType.stringg, sortDir = SortDirection.ASC });

            ArrayReader reader = new ArrayReader();
            reader.recordType = record;

            return reader;
        }

    }
}